/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpaintball;

import java.awt.Color;
import java.awt.Graphics2D;


public class Paintball extends MovableGameObject {

    Paintball(int startX, int startY, double angle, double _frametime) {
        
        super(startX, startY, 3, 3, 2, 2, 0, _frametime);
        angle = angle - Math.PI/2;
        speedX = frametime*700*Math.cos(angle);
        speedY = frametime*700*Math.sin(angle);
    }

    public void drawSprite(Graphics2D g2d) {
        g2d.setColor(Color.YELLOW);
        g2d.fillOval(position.getX(), position.getY(), position.getWidth(), position.getHeight());
    }

    public void move() {
        position.relativeMove(speedX, speedY);
    }

    public void setCollisionWith(GameObject o) {
        // Paintball splats when it hits something
        Destroy();
    }

}
